// ValidationAspects
// Written by Mike Saunders
// Released under Microsoft Public License (Ms-PL)
using System;
using ValidationAspects.Exceptions;
using ValidationAspects.Sdk;

namespace ValidationAspects.Core
{
	internal class ExceptionMessageFormatter : IFormatExceptionMessage
	{
		#region Implementation of IFormatExceptionMessage
		public void GreaterThan(Func<ValidateGreaterThanException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateGreaterThanException.MessageFormat = formatMessage;
		}

		public void InRange(Func<ValidateInRangeException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateInRangeException.MessageFormat = formatMessage;
		}

		public void IsDate(Func<ValidateIsDateException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateIsDateException.MessageFormat = formatMessage;
		}

		public void IsEmail(Func<ValidateIsEmailException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateIsEmailException.MessageFormat = formatMessage;
		}

		public void LengthInRange(Func<ValidateLengthInRangeException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateLengthInRangeException.MessageFormat = formatMessage;
		}

		public void LessThan(Func<ValidateLessThanException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateLessThanException.MessageFormat = formatMessage;
		}

		public void MatchesRegex(Func<ValidateMatchesRegexException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateMatchesRegexException.MessageFormat = formatMessage;
		}

		public void Maximum(Func<ValidateMaximumException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateMaximumException.MessageFormat = formatMessage;
		}

		public void MaximumLength(Func<ValidateMaximumLengthException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateMaximumLengthException.MessageFormat = formatMessage;
		}

		public void Minimum(Func<ValidateMinimumException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateMinimumException.MessageFormat = formatMessage;
		}

		public void MinimumLength(Func<ValidateMinimumLengthException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateMinimumLengthException.MessageFormat = formatMessage;
		}

		public void NotEqual(Func<ValidateNotEqualException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateNotEqualException.MessageFormat = formatMessage;
		}

		public void NotNull(Func<ValidateNotNullException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateNotNullException.MessageFormat = formatMessage;
		}

		public void NotNullOrEmpty(Func<ValidateNotNullOrEmptyException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateNotNullOrEmptyException.MessageFormat = formatMessage;
		}

		public void NotInRange(Func<ValidateNotInRangeException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateNotInRangeException.MessageFormat = formatMessage;
		}

		public void ValidateObject(Func<ValidateObjectException, string> formatMessage)
		{
			Enforce.IsNotNull(formatMessage, "formatMessage");
			ValidateObjectException.MessageFormat = formatMessage;
		}
		#endregion
	}
}